#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

int main() {
  pid_t pid = fork();
  if (pid == 0) {
    printf("child pid = %d, ppid = %d\n", getpid(), getppid());
  } else if (pid > 0) {
    while (1) {
      sleep(1);
      printf("parent\n");
      printf("parent pid = %d, ppid = %d\n", getpid(), getppid());
    }
  }
  return 0;
}
